hysop.backend.host.host_buffer module

class hysop.backend.host.host_buffer.HostBuffer(size, shape=None, dtype=<class 'numpy.uint8'>, order=None, buffer=None, offset=0, strides=None)[source]

Bases: ndarray, Buffer

Host buffer class.

aligned_view(alignment, size=None)[source]

Return a view of this buffer with an offset such that the returned buffer is now aligned on min_alignment and has now given size.

classmethod from_buffer(buf)[source]
classmethod from_int_ptr(int_ptr_value, size)[source]

Given int ptr should never be freed, numpy take ownership.

get_int_ptr()[source]
property int_ptr
release()[source]

Release this buffer (decrease internal implementation defined reference counter).

class hysop.backend.host.host_buffer.HostPooledBuffer(pool, buf, alloc_sz, size, alignment, **kwds)[source]

Bases: PooledBuffer

Create a memory pool wrapped buffer. Input buffer buf was allocated by given pool with real size alloc_sz. Buffer is resized and aligned to given size and alignment. On destruction, buffer will be given back to the pool.

property array
get_array()[source]